#ifndef GAME_MANAGER_H
#define GAME_MANAGER_H

#include "State.h"
#include "Window.h"
#include <vector>
#include "ScriptManager.h"
#include "EventManager.h"

                        /** GameManager Class **/
 /*****************************************************************************
 *                                                                            *
 * The GameManager class runs the main game loop handling game states and     *
 * is where the window is handled/located                                     *
 *                                                                            *
 *****************************************************************************/

class GameManager
{
    public:
        GameManager(unsigned int width = 800, unsigned int height = 600, std::string title = "OpenGL");
        virtual ~GameManager();

        void run();

        void init();
        void render();
        void update();
        void handleEvents();

        void pushState(State* s);
        void popState();

    private:
        Window              _window;
        EventManager*       _eventMgr;
        sf::Event           _event;
        std::vector<State*> _states;
        bool                _alive;

};

#endif // GAME_MANAGER_H
